<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h3></h3>
    <div id="app">
        <my-component>
            <template scope="myProps">
                <p><span style="color:red;">{{myProps.text}}</span>,父组件从子组件接收到的数据</p>
            </template>
        </my-component>
    </div>
    <script type="text/javaScript" charset="UTF-8" src="/JS文件/vue.js"></script>
    <script>
        Vue.component("my-component",{
            template:`<div class="container">
                <slot text="hello from child"></slot>
                </div>`
        })
        var vm = new Vue({
            el:'#app'
        })
    </script>
</body>
</html>